﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;

namespace Indie_Game_Contest
{
    class CTileManager : Microsoft.Xna.Framework.Game
    {

        //private int nID = 0;
        private Dictionary<string, int> tileIDs = new Dictionary<string, int>();

        public Dictionary<string, int> TileIDs
        {
            get { return tileIDs; }
            set { tileIDs = value; }
        }

        
        //////////////////////////////////////////////////////////////////////////
        // Data Members
        static CTileManager instance;
        public static CTileManager Instance
        {
            get
            {
                if (instance == null)
                    instance = new CTileManager();

                return instance;
            }
        }
        //////////////////////////////////////////////////////////////////////////

        //public int NID
        //{
        //    get { return nID; }
        //    set { nID = value; }
        //}

        public int GetTileID(string szName)
        {
            return TileIDs[szName];
        }

        public void LoadTile( string szFilePath )
        {
            Texture2D local = Content.Load<Texture2D>(szFilePath);
            TileIDs[local.Name] = TextureManager.Instance.AddTexture( local );
        }

        public void LoadContent(List< string > szFilePaths)
        {
            for (int i = 0; i < szFilePaths.Count; ++i)
                LoadTile( szFilePaths[i]);
        }

        public void Destrcutor()
        {
            TileIDs.Clear();
        }
        //enum TilesSet { SINGLE, ARCH, BG_ARCH, BG_LEFT, BG_RIGHT, BG_PLANTSMALL, BG_PLANTBIG };


    }
}
